package com.tuanzi.loan.business.service.wallet.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tuanzi.loan.business.entity.wallet.LoanUserWalletFlow;
import com.tuanzi.loan.business.repository.wallet.LoanUserWalletFlowRepository;
import com.tuanzi.loan.business.repository.wallet.custom.LoanUserWalletFlowRepositoryCustom;
import com.tuanzi.loan.business.service.wallet.LoanUserWalletFlowService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.wallet.LoanUserWalletFlowRequest;
import com.tuanzi.loan.vo.response.wallet.LoanUserWalletFlowResponse;

@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class LoanUserWalletFlowServiceImpl extends CommonServiceImpl<LoanUserWalletFlow, Long> implements LoanUserWalletFlowService{
	
	@Autowired
	private LoanUserWalletFlowRepositoryCustom loanUserWalletFlowRepositoryCustom;
	
	@Autowired
	private LoanUserWalletFlowRepository loanUserWalletFlowRepository;

	@Override
	public Page<LoanUserWalletFlowResponse> list(
			PageSearcher<LoanUserWalletFlowRequest> pageSearcher) {
		return loanUserWalletFlowRepositoryCustom.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
	}

	@Override
	protected JpaRepository<LoanUserWalletFlow, Long> getRepository() {
		return loanUserWalletFlowRepository;
	}

}
